package com.wenxin.springbootcacheconsistency.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wenxin.springbootcacheconsistency.domain.Order;
import com.wenxin.springbootcacheconsistency.mapper.OrderMapper;
import com.wenxin.springbootcacheconsistency.service.OrderService;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
* @author Administrator
* @description 针对表【order(订单表)】的数据库操作Service实现
* @createDate 2024-12-25 16:42:11
*/
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order>
    implements OrderService {

    @Override
    public void createOrder(Long goodsId, Long stock) {
        Order order = new Order();
        String orderNo = UUID.randomUUID().toString();
        order.setOrderNo(orderNo);
        order.setTitle("购买" + stock + "件" + goodsId);
        save(order);
    }
}




